package 贪心;

import java.util.Arrays;

public class ChangeMoney {
	public static void main(String[] args) {
		changeMoney();
	}

	public static void changeMoney() {
		int[] changes = new int[] { 25, 20, 5, 1 };
		Arrays.sort(changes);
		int money = 41;
		int i = changes.length - 1;
		int coins = 0;
		while (money > 0) {
			if (money >= changes[i]) {
				money -= changes[i];
				coins++;
			} else {
				i--;
			}
		}
		System.out.println(coins);
	}
}
